<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>{$webname}</title>
    <link rel="stylesheet" href="__PUBLIC__/adn/view3dstyle.min.css">
</head>


<body class="layui-layout-body">

    <if condition="$error">
        {$errormsg}
    <else />
        <script src="__PUBLIC__/adn/jquery-2.1.4.min.js"></script>
        <script src="__PUBLIC__/adn/three.min.js"></script>
        <script src="__PUBLIC__/adn/viewer3D.min.js"></script>
        <script>
            $(function(){
                var mainContainerHeight = $(window).height();
                $("#Adn").css("height",mainContainerHeight);
                var myViewerDiv = document.getElementById('Adn');
                var viewer = new Autodesk.Viewing.Private.GuiViewer3D(myViewerDiv);
                var options = {
                    'env': 'Local'
                };

                //init
                var src = "{$src}";//$(this).attr('data-src');

                Autodesk.Viewing.Initializer(options, function() {
                    viewer.initialize();                    //init
                    viewer.impl.unloadModel(viewer.model);  //清除model
                    viewer.setReverseZoomDirection(true);   //设置鼠标滚轮
                    viewer.loadModel(src);                  //加载model
                    viewer.addEventListener(Autodesk.Viewing.GEOMETRY_LOADED_EVENT, function (event){
                        //viewer.fitToView (false);viewer.setSelectionMode(Autodesk.Viewing.SelectionMode.FIRST_OBJECT);
                    }); //模型加载完成后视角默认
                });
            });
        </script>
    </if>
    <div id="Adn" style="width:500px;"></div>







</body>
</html>